1. Field of the Invention
The present invention relates to an object-oriented language and more particularly, to a way and a system for invoking a method in the object-oriented language from a part object to a whole object dependent on the part object.
2. Description of the Related Art
In a computer realizing an object-oriented language, as shown in FIG. 10, there are present a whole object 111 and a part object 113 bound by an instance variable 112 which the whole object 111 possesses, so that the invocation of a method 114 for the whole object 111 causes a message to be sent from the whole object 111 to the part object 113. The part object 113, when receiving the message from the whole object, invokes its own method.
Such a procedure is repeated so that the message is further sent from the part object to a sub-part object of the part object. Accordingly, computation in the object-oriented language is carried out by sequentially sending the message in a direction from the whole object toward the part object to invoke the method.
The details of a way of invoking a method in the object-oriented language is disclosed, for example, in a publication "Smalltalk-80: The Language and Its Implementation", by Goldberg, A. and Robson, D., Addison-Wesley, 1983.
However, such a system that can send a message in a direction from a whole object toward a part object and can invoke a method on the basis of only the message, has had a problem, for example, in a case where a certain part object is bound by the respective instance variables of a plurality of whole objects.
For example, when there are present first and second whole objects 121 and 122 and a part object 123 belonging to both of the whole objects as shown in FIG. 11, the part object 123 is bound by respective instance variables 124 and 125 of the first and second whole objects 121 and 122, so that the part object 123 can receive messages from the both whole objects. It is now assumed that such an exclusive relationship that one of the two instance variables 124 and 127 of the whole object 121 is turned "ON" while the other is turned "OFF" must be satisfied. In this case, since the two instance variables 124 and 127 satisfy the exclusive relationship, when a method 126 of the whole object 121 is invoked, a message is sent from the first whole object 121 to the part object 123 while another message is sent from the whole object 121 to the other part object 128, in which case an exclusive relationship is maintained between these part objects 123 and 128.
However, when a method (not shown) of the second whole object 122 is invoked to send a message from the second whole object 122 to the part object 123 as shown in FIG. 12, the part object 123 is operated but the method 126 of the first whole object 121 is not invoked, which results in that the message to be sent via the instance variable 127 of the first whole object 121 is not sent to the part object 128 and therefore the exclusive relationship cannot be satisfied between the part objects 123 and 128.
In other words, when a part object is shared by a plurality of whole objects or a message to a part object is not sent necessarily via its predetermined whole object, a predetermined mutual relationship between part objects cannot be always satisfied. This results from the fact that, upon transmission of a message to a part object, a predetermined method for satisfying the mutual relationship in the plurality of whole objects is not invoked.